
import java.awt.*;

import javax.swing.*;

	public class QueuePanel extends JPanel
	{
		private int _queueNr;
		private JList _lstCustomersInQueue;
		private ButtonServePerson _butServe;
		private ButtonSwapQueueStatus _butSwap;
		
		public QueuePanel(Store _store, int nr, JFrame parent)
		{
			super(new BorderLayout());
			_queueNr = nr;
			_lstCustomersInQueue = new JList(_store.getQueues()[_queueNr].getCustomers());
			_butServe = new ButtonServePerson(_store, _lstCustomersInQueue, _queueNr, parent);
			_butSwap = new ButtonSwapQueueStatus(_store, _lstCustomersInQueue, _queueNr);
			
			this.add(_butSwap, BorderLayout.NORTH);
			this.add(new JScrollPane(_lstCustomersInQueue), BorderLayout.CENTER);
			this.add(_butServe, BorderLayout.SOUTH);
			this.setPreferredSize(new Dimension(30,150));
			
			if(_store.getQueues()[_queueNr].getStatus())
			{
				_lstCustomersInQueue.setVisible(true);
			}
			else
				_lstCustomersInQueue.setVisible(false);
		}
	}